USE [Training]
GO

IF NOT EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.training_api_PositionSkillSetSelect'))
	EXEC('CREATE PROC dbo.training_api_PositionSkillSetSelect AS')
GO

ALTER PROC dbo.training_api_PositionSkillSetSelect
	@PositionID	int
AS
	SELECT
		SkillSetID,
		Title
	FROM SkillSet
	WHERE SkillSetID IN(
		SELECT SkillSetID
		FROM Position_SkillSet
		WHERE PositionID = @PositionID)
	ORDER BY
		Title
